import xml.dom.minidom
from xml.dom.minidom import Node

class Album:
	def __init__(self, node):
		self.parse(node)
		self.titles = []
	def parse(self, node):
		tmp = node.getElementsByTagName("album")[0]
		lst = []
		for i in tmp.childNodes:
			if i.nodeType == i.TEXT_NODE:
				lst.append(i.data)
		self.name = ''.join(lst)
	def addTitle(self, title):
		if self.isExisting(title) == False:
			self.titles.append(title)
	def isExisting(self, title):
		for i in self.titles:
			if title.name == i.name:
				return True
		return False
